package it.polimi.traveldream.web;

import it.polimi.traveldream.CreatedPackageDTO;
import it.polimi.traveldream.GestioneRicercaLocal;
import it.polimi.traveldream.ModificaPacchettoLocal;
import it.polimi.traveldream.PackageDTO;

import java.util.ArrayList;
import java.util.Map;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;


@ManagedBean(name="modificaPacchettoBean")
@SessionScoped
public class ModificaPacchettoBean {
	
	
	@EJB
	private ModificaPacchettoLocal gs;
	
	private CreatedPackageDTO current;
	
	/*private ArrayList<String>selectedhotels;
	private ArrayList<String>selectedvoliandata;
	private ArrayList<String>selectedvoliritorno;
	private ArrayList<String>selectedescursioni;*/
	
	public ModificaPacchettoBean(){
		this.current=new CreatedPackageDTO();
	}
	
	public CreatedPackageDTO getCurrent(){
		return this.current;
	}
	
	public void setCurrent(CreatedPackageDTO current){
		this.current=current;
	}
	
	public String modify(int id){
		this.current.setId(id);
		gs.modify(this.current);
		return "/employee/index.xhtml?faces-redirect=true";
	}
	
	
	
}
